
@extends('common.header')

<!-- 1.添加meta csrf_token -->
<meta name="csrf-token" content="{{ csrf_token() }}">  
<script src=" {{ asset('/js/jquery-1.8.3.min.js') }} "></script>
<script type="text/javascript">
	
	<!-- 2.设置全局ajax选项 -->
	$.ajaxSetup({
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		}
	});
	// 获取 token
	var _token = $('meta[name="csrf-token"]').attr('content');
	
		
</script>
<body>

<br/>
<br/>
<br/>
<br/>
<br/>


<div class="col-xs-12 col-sm-6 col-md-1">
</div>	


<!-- 页面标记  -->
<div class="col-xs-12 col-sm-6 col-md-1" style="text-align:center;color:#32CD32;font-size:25px;">
	{{ $title or '' }}
</div>	
	
<div class="col-xs-12 col-sm-6 col-md-10" >
	<!-- 添加 网站配置 表单  -->
	
	<!-- 网站名称 -->
	<div  class="form-group">
		<label class="col-sm-2 control-label">网站名称</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="webName" value="{{ $history->webName or '' }}" class="form-control"  placeholder="网站名称" />
		</div>
	</div>
	
	
	<!-- 首页 -->
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">首页标题</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="indexTitle" value="{{ $history->indexTitle or '' }}" class="form-control"  placeholder="首页标题" />
		</div>
	</div>
	
	
	
	<br/><br/>
	<div  class="form-group">
	  <label class="col-sm-2 control-label">首页关键词</label>
	  <div class="col-sm-10">
		<input style="width:830px;" type="text" name="indexKey" value="{{ $history->indexKey or '' }}" class="form-control"  placeholder="首页关键词">
	  </div>
	</div>
	
	
	<br/><br/>
	<div  class="form-group">
	  <label class="col-sm-2 control-label">首页描述</label>
	  <div class="col-sm-10">
		<input style="width:830px;" type="text" name="indexDesc" value="{{ $history->indexDesc or '' }}" class="form-control"  placeholder="首页描述">
	  </div>
	</div>
	
	
	<!-- 资料库 -->
	<br/><br/>
	<div  class="form-group">
	  <label class="col-sm-2 control-label">资料库标题</label>
	  <div class="col-sm-10">
		<input style="width:830px;" type="text" name="databaseTitle" value="{{ $history->databaseTitle or '' }}" class="form-control"  placeholder="资料库标题">
	  </div>
	</div>
	
	<br/><br/>
	<div  class="form-group">
	  <label class="col-sm-2 control-label">资料库关键词</label>
	  <div class="col-sm-10">
		<input style="width:830px;" type="text" name="databaseKey" value="{{ $history->databaseKey or '' }}" class="form-control"  placeholder="资料库关键词">
	  </div>
	</div>
	
	
	
	<br/><br/>
	<div  class="form-group">
	  <label class="col-sm-2 control-label">资料库描述</label>
	  <div class="col-sm-10">
		<input style="width:830px;" type="text" name="databaseDesc" value="{{ $history->databaseDesc or '' }}" class="form-control"  placeholder="资料库描述">
	  </div>
	</div>
	
	
	<!-- 球队 -->
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球队标题</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="teamTitle" value="{{ $history->teamTitle or '' }}" class="form-control"  placeholder="球队标题">
		</div>
	</div>
	
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球队关键词</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="teamKey" value="{{ $history->teamKey or '' }}" class="form-control"  placeholder="球队关键词">
		</div>
	</div>
	
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球队描述</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="teamDesc" value="{{ $history->teamDesc or '' }}" class="form-control"  placeholder="球队描述">
		</div>
	</div>
	
	<!-- 球员 -->
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球员标题</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="playerTitle" value="{{ $history->playerTitle or '' }}" class="form-control"  placeholder="球员标题">
		</div>
	</div>
	
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球员关键词</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="playerKey" value="{{ $history->playerKey or '' }}" class="form-control"  placeholder="球员关键词">
		</div>
	</div>
	
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">球员描述</label>
		<div class="col-sm-10">
			<input style="width:830px;" type="text" name="playerDesc" value="{{ $history->playerDesc or '' }}" class="form-control"  placeholder="球员描述">
		</div>
	</div>
	
	
	<!-- 网站配置 -->
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">是否关闭</label>
		<div class="col-sm-10">
			@if( $history->isclose=='1' )
				<input  type="radio" name="isclose" value="1" id="open" checked style="cursor:pointer;" /><label style="cursor:pointer;" for="open">开启</label>
				&nbsp;&nbsp;&nbsp;
				<input  type="radio" name="isclose" value="2" id="close" style="cursor:pointer;" /><label style="cursor:pointer;" for="close">关闭</label>
			@else
				<input  type="radio" name="isclose" value="1" id="open"  style="cursor:pointer;" /><label style="cursor:pointer;" for="open">开启</label>
				&nbsp;&nbsp;&nbsp;
				<input  type="radio" name="isclose" value="2" id="close" checked style="cursor:pointer;" /><label style="cursor:pointer;" for="close">关闭</label>
			@endif
		</div>
	</div>
	
	
	<br/><br/>
	<div  class="form-group">
		<label class="col-sm-2 control-label">刷新首页缓存</label>
		<div class="col-sm-10">
			<button id="cache" style="width:200px;" class="btn btn-default">刷新首页缓存</button>
		</div>
	</div>
	
	
</div>
	

<div class="col-xs-12 col-sm-6 col-md-12" style="text-align:center;">
	<button id="confirm" style="width:300px;margin-top:2%;" data-toggle="modal" data-target=".bs-example-modal-sm" class="btn btn-danger">确认配置</button>
</div>	


<div class="col-xs-12 col-sm-6 col-md-12" style="text-align:center;margin-bottom:100px;margin-top:1%;">
	<a href ="javascript:history.back();" style="width:300px;" class="btn btn-success">
		返回
	</a>
</div>
	
	
	
<!-- 模态框 不要动 -->	
<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
	<div class="modal-dialog modal-sm" role="document" id='show_info'  style="margin-top:80px;margin-left:50%;color:white;font-size:20px;">
	</div>
</div>	
	
	
	


<script type="text/javascript">
		
	// 获取 token
	var _token = $('meta[name="csrf-token"]').attr('content');
	$(function(){
	
		// 刷新首页缓存
		$("#cache").click(function(){
			
			$.ajax({ 
				type : 'get', 
				url : "http://www.qian.com/clearIndex",
				data :{}, 
				async:true,    					
				dataType:"json",
				success : function(back) { 
					alert(back['show_info']);
				}
			});
			
		});
		
		// 网站 配置
		$("#confirm").click(function(){
			
			// 网站名称
			var webName	=	$("input[name='webName']").val();
			
			// 首页标题
			var indexTitle	=	$("input[name='indexTitle']").val();
			// 首页关键词
			var indexKey	=	$("input[name='indexKey']").val();
			// 首页描述
			var indexDesc	=	$("input[name='indexDesc']").val();
			
			// 资料库标题
			var databaseTitle	=	$("input[name='databaseTitle']").val();
			// 资料库首页关键词
			var databaseKey	=	$("input[name='databaseKey']").val();
			// 资料库首页描述
			var databaseDesc	=	$("input[name='databaseDesc']").val();
			
			// 球队标题
			var teamTitle	=	$("input[name='teamTitle']").val();
			// 球队关键词
			var teamKey	=	$("input[name='teamKey']").val();
			// 球队描述
			var teamDesc	=	$("input[name='teamDesc']").val();
			
			// 球员标题
			var playerTitle	=	$("input[name='playerTitle']").val();
			// 球员关键词
			var playerKey	=	$("input[name='playerKey']").val();
			// 球员描述
			var playerDesc	=	$("input[name='playerDesc']").val();
			
			
			// 是否关闭
			var isclose	=	$("input[name='isclose']:checked").val();
			
			$.ajax({ 
				type : 'post', 
				url : "{{ url('/dowebconfig') }}", 
				data :{webName:webName,indexTitle:indexTitle,indexKey:indexKey,indexDesc:indexDesc,databaseTitle:databaseTitle,databaseKey:databaseKey,databaseDesc:databaseDesc,teamTitle:teamTitle,teamKey:teamKey,teamDesc:teamDesc,playerTitle:playerTitle,playerKey:playerKey,playerDesc:playerDesc,isclose:isclose,_token:_token}, 
				async:true,    					
				dataType:"json",
				success : function(back) { 
					// 2.模态框 不要动
					$('#show_info').html( '' );
					$('#show_info').html( back['show_info'] );
					if( back['show_info']=='配置成功' )
					{
						setTimeout(function(){
							location.reload();
						},1000); 
					}
					
				}
			});
			
		});
	});

</script>
</body>
@extends('common.footer')